<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>eater</title>
</head>
<body>
<script>
    function eater(){
        var food = "";
        var foodObj = {
            eat : function (){
                console.log("I am eating " + food);
                food = "";
            },
            push : function (myFood){
                food = myFood;
            }
        };
        return foodObj;
    }
    var eaterOne = eater();
    eaterOne.push("apple");
    eaterOne.eat();
</script>
</body>
</html>
